import request from '@/utils/request'

// 查询BOM清单列表
export function listBoms(query) {
  return request({
    url: '/base-data-service/base/boms/list',
    method: 'get',
    params: query
  })
}

// 查询BOM清单详细
export function getBoms(bomId) {
  return request({
    url: '/base-data-service/base/boms/' + bomId,
    method: 'get'
  })
}

// 新增BOM清单
export function addBoms(data) {
  return request({
    url: '/base-data-service/base/boms',
    method: 'post',
    data: data
  })
}

// 修改BOM清单
export function updateBoms(data) {
  return request({
    url: '/base-data-service/base/boms',
    method: 'put',
    data: data
  })
}

// 删除BOM清单
export function delBoms(bomId) {
  return request({
    url: '/base-data-service/base/boms/' + bomId,
    method: 'delete'
  })
}

//根据productId查bom
export function getBomByProductId(productId) {
  return request({
    url: '/base-data-service/base/boms/productId/' + productId,
    method: 'get'
  })
}
